<!DOCTYPE html>
<html>
<head>
    {include file="layout:_meta" /}
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">

    <div class="layui-form-item">
        <label class="layui-form-label">广告分组/位</label>
        <div class="layui-input-block">
            <input type="text" name="name"  placeholder="请输入广告分组/位" lay-verify="required"  value="{:isset($list.name)?$list.name:''}" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">序号</label>
        <div class="layui-input-block">
            <input type="number" name="sort" lay-verify="" placeholder="请输入序号 数字越小排序越靠前" lay-reqtext=""  autocomplete="off" value="{:isset($list.sort)?$list.sort:''}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">描述</label>
        <div class="layui-input-block">
            <textarea name="description" lay-verify="" placeholder="请输入描述" autocomplete="off" class="layui-textarea">{:isset($list.description)?$list.description:''}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            {if condition="isset($list.state)&&$list.state==1"}
            <input type="checkbox" lay-filter="state"  checked value="1" name="state" lay-skin="switch" lay-text="启用|禁用">
            {else /}
            <input type="checkbox" lay-filter="state"  value="0" name="state" lay-skin="switch" lay-text="启用|禁用">
            {/if}
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="hidden" name="id" value="{:isset($list['id'])?$list['id']:''}">
        <input type="hidden" name="token" value="{:isset($list['token'])?$list['token']:''}">
        <input type="button" lay-submit lay-filter="addEdit" id="addEdit" value="确认">
    </div>
</div>
{include file="layout:_footer" /}
<script>
    layui.config({
        base: '__static__/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form','upload'], function(){
        var form = layui.form,$ = layui.$,upload = layui.upload;


        form.on('switch(state)', function(data){
            this.value = this.checked?1:0;
        });
    })
</script>
</body>
</html>